﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using NTTDATA.BEENChina.ResultCertification.Main.ServiceEntry;
namespace NTTDATA.BEENChina.ResultCertification.UI
{
    public partial class FormReceiveDates : Form
    {
        public FormReceiveDates()
        {
            InitializeComponent();
        }

        private void FormReceiveDates_Load(object sender, EventArgs e)
        {
            using (ServiceEntryClient client = new ServiceEntryClient())
            {
                List<string> dateList = client.GetDistinctOridReceiveDates();
                if (dateList != null)
                {
                    this.listboxDates.DataSource = dateList;
                }
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnMakeJob_Click(object sender, EventArgs e)
        {
            string oridReceiveDate = listboxDates.SelectedValue.ToString();

            using (ServiceEntryClient client = new ServiceEntryClient())
            {
               client.MakeJob(oridReceiveDate);
            }
        }
    }
}
